SIRFORMAT VERSION 9
======================

[UINT16]  VERSION
[UINT16]  WIDTH
[UINT16]  HEIGHT
[BYTE*5]  LZMA-Properties
[BYTE{}]  LZMA-Compressed Data
------------------------
DECOMPRESSED LZMA DATA:
------------------------
[UINT08]  INTENSITY (0..255)
[UINT16]  # PATHS
{
 [UINT16]  X
 [UINT16]  Y
 [UINT16]  RADIUS

# Note: Point-chain encoding works from 0..7 as shown:
# 0 1 2
# 3   4
# 5 6 7
#
# END-Tag (9 << 4 or 9 in the high nibble) marks the end of an object
# FORK-Tag(10 << 4 or 10 in the high nibble) marks end of a branch. This
# also means that the next nibble is meaningless (denotes non existing
# radius.  The next UINT16 denotes the number of points to go back in 
# reading state.
 {
   [NIBBLE]  Next point using chain encoding
   [NIBBLE]  Next radius using chain encoding
  [ [UINT16] GOBACK (on FORK tag) ]
 }
}













OLD SIRFOMAT:
======================

WIDTH           2 bytes, thus maximum width is 65536.
HEIGHT           2 bytes, thus maximum height is 65536
REPEATING PATHS:
{{
  INTENSITY    1 byte, (range 0-255) denoting the channel intensity of the current path
  LENGTH        3 bytes, denoting the number of points that will FOLLOW after the base point. (0-16.777.216)
  X,Y,R        16,16,16 bits. The first point of the layer where R is the radius of the disk.
  {{
    x,y,r      LENGTH times 4 bits, denoting the "next"-position of a disk* + 4 bits for delta radius
  }}
}}

====

* The "next" disk is encoded using a neighbour-path, with the following encoding:

0 1 2
3   4
5 6 7

This means that we can encode a path of points using 4 bits per point.

** The difference in radius should be smooth, therefore we should be able to use a maximum difference of 255 for a path.
